import {Http} from "../utils/http";

class Pets extends Http {
    constructor(props) {
        super(props);
    }


    add(
        houseId,
        name,
        sex,
        brend,
        type,
        color,
        adoptId,
        adoptDate,
        vaccine,
        adoptionPic,
        vaccinePic,
        pic
    ) {
        return this.request({
            url: '/mini/peg/add',
            method: 'post',
            data: {
                houseId,
                name,
                sex,
                brend,
                type,
                color,
                adoptId,
                adoptDate,
                vaccine,
                adoptionPic,
                vaccinePic,
                pic
            }
        })
    }

    edit(
        id,
        houseId,
        name,
        sex,
        brend,
        type,
        color,
        adoptId,
        adoptDate,
        vaccine,
        adoptionPic,
        vaccinePic,
        pic
    ) {
        return this.request({
          url: "/mini/peg/edit",
          method: "post",
          data: {
            id,
            houseId,
            name,
            sex,
            brend,
            type,
            color,
            adoptId,
            adoptDate,
            vaccine,
            adoptionPic,
            vaccinePic,
            pic,
          },
        });
    }

    del(id) {
        return this.request({
          url: "/mini/peg/delete",
          data: {
            id,
          },
        });
    }

    list() {
        return this.request({
          url: "/mini/peg/list",
        });
    }

    getById(id) {
        return this.request({
            url: '/mini/peg/queryById',
            data: {
                id
            }
        })
    }

    getSex() {
        return this.request({
          url: "/mini/peg/sex",
        });
    }

    //种类
    getKind() {
        return this.request({
            url: '/app/pegCode/var',
            data: {}
        })
    }

    //品种
    getVariety(code) {
        return this.request({
            url: '/app/pegCode/brend',
            data: {
                code
            }
        })
    }

    //类型
    getType(code) {
        return this.request({
            url: '/app/pegCode/type',
            data: {
                code
            }
        })
    }
    //房屋地址
    getHouse(){
        return this.request({
          url: "/mini/peg/house",
          data: {},
        });
    }

    //体型
    getPetSize(){
        return this.request({
          url: "/mini/peg/type",
          data: {},
        });
    }

    //颜色
    getPetColor(){
        return this.request({
          url: "/mini/peg/color",
        });
    }

}

export {
    Pets
}
